#include "Tcpserver.hpp"
#include <memory>

void Usage(char *proc)
{
    cout << "Usage:\n\t";
    cout << proc << " port" << endl;
}

int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }

    int port = stoi(argv[1]); // 端口号
    unique_ptr<Tcpserver> server(new Tcpserver(port));

    server->Init();
    server->Start();

    return 0;
}